<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/favicon.ico"/>
<title><?php if(isset($seotitle)): echo ($seotitle); else: ?>[title]<?php endif; ?> - 网站管理系统</title>
<link type="text/css" rel="stylesheet" href="/Public/admin/style/default.css" />
<script type="text/javascript" src="/Public/admin/js/jquery-1.7.min.js"></script>
<script type="text/javascript" src="/Public/admin/plugin/artDialog/jquery.artDialog.js?skin=default"></script>
<script type="text/javascript" src="/Public/admin/plugin/artDialog/plugins/iframeTools.source.js"></script>
<script type="text/javascript" src="/Public/admin/plugin/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/Public/admin/js/reset.js"></script>
<script type="text/javascript" src="/Public/admin/js/master.js"></script>
<script type="text/javascript" src="/Public/admin/plugin/layer/layer.js"></script>




</head>

<body>
<div class="mainWrap">
	
    <!--标题-->
    <div class="mainWrapHeader">
    	<h1 class="mainWrapTit"><?php echo ($seotitle); ?></h1>
    </div>
    <!--标题-->
    
    <form action="<?php echo U('save',array('action'=>'add'));?>" method="post" class="dataForm" id="dataForm">
    <div class="mainWrapBd">
    	<div class="tab-con" id="tab-works">
            <table cellpadding="0" border="0" cellspacing="0" class="stdedit">
                <tr>
                    <th>标题</th>
                    <td><input type="text" name="title" id="title" class="sys_text sys_text250" /></td>
                </tr>
                <tr>
                    <th>简介</th>
                    <td><input type="text" name="description" id="description" class="sys_text sys_text250"  /></td>
                </tr>

                <!-- <tr>
                    <th>封面</th>
                    <td>
                        <input type="text" name="surface_img" id="surface_img" class="sys_text sys_text50" readonly/>
                        <a href="javascript:;" onclick="getOneFile('surface_img', 'image')" class="btn btn_orange btn_inboxo"><span>上传</span></a>
                    </td>                    
                </tr> -->

                <tr>
                    <th>作者</th>
                    <td>
                        <select name="teacher_id">
                            <option value="0">请选择分类</option>
                            <?php if(is_array($categorys)): $i = 0; $__LIST__ = $categorys;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><option value="<?php echo ($v['id']); ?>"><?php echo ($v['nickname']); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                        </select>
                    </td>
                </tr>

                <tr>
                    <th>期数</th>
                    <td>
                        <?php
 $period = M('period a')->order("a.id desc")->select(); ?>
                        

                        <div class="setWrap ruleWrap ruleWrapCur">
                            <div class="setWrapBody">
                                <ul class="clearfix ruleList">
                                    <?php if(is_array($period)): $i = 0; $__LIST__ = $period;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$foo): $mod = ($i % 2 );++$i;?><li><label><input type="checkbox" name="period[]" <?php if(in_array($foo['id'],$arr)): ?>checked="checked"<?php endif; ?> value="<?php echo ($foo['id']); ?>"> <?php echo ($foo['name']); ?></label></li><?php endforeach; endif; else: echo "" ;endif; ?>
                                </ul>
                            </div>
                        </div>

                    </td>
                </tr>

                <tr>
                    <th>视频</th>
                    <td>
                        <div role="tabpanel" class="tab-pane fade in active" id="demo" aria-labelledby="demo-tab">

                            <div class="row" style="margin-top: 20px;">

                                <input type="hidden" id="domain" value="http://tingxi.45tnz.com/">
                                <input type="hidden" id="uptoken_url" value="uptoken">
                                
                                <div class="col-md-12">
                                    <div id="container" style="position: relative;">
                                        <a class="btn btn_orange btn_inboxo" id="pickfiles" style="position: relative; z-index: 1;">
                                            <i class=""></i>
                                            <span>选择文件</span>

                                        </a>
                                        <input type="text" name="video_url" id="video_url" class="sys_text sys_text230" readonly/>
                                    <div id="html5_1aj3rtennnga1n5h927gjn8343_container" class="moxie-shim moxie-shim-html5" style="position: absolute; top: 0px; left: 0px; width: 171px; height: 46px; overflow: hidden; z-index: 0;"><input id="html5_1aj3rtennnga1n5h927gjn8343" type="file" style="font-size: 999px; opacity: 0; position: absolute; top: 0px; left: 0px; width: 100%; height: 100%;" multiple="" accept=""></div></div>
                                </div>
                                <div style="display:none" id="success" class="col-md-12">
                                    <div class="alert-success">
                                        上传成功
                                    </div>
                                </div>
                                <div class="col-md-12 ">
                                    <table class="table table-striped table-hover text-left" style="margin-top:40px;display:none">
                                       <!--  <thead>
                                         <tr>
                                           <th class="col-md-4">文件名</th>
                                           <th class="col-md-2">大小</th>
                                           <th class="col-md-6">详情</th>
                                         </tr>
                                       </thead> -->
                                        <tbody id="fsUploadProgress">
                                        </tbody>
                                    </table>
                                </div>
                            </div>

                        </div>
                        

                        <!-- <input type="text" name="thumb" id="thumb" class="sys_text sys_text50" />
                        <a href="javascript:;" onclick="getOneFile('thumb', 'image')" class="btn btn_orange btn_inboxo"><span>上传</span></a> -->
                    </td>                    
                </tr>
                
                <!-- <tr>
                    <th>排序</th>
                    <td><input type="text" name="sortid" id="sortid" value="<?php echo ((isset($maxSortId) && ($maxSortId !== ""))?($maxSortId):0); ?>" class="sys_text sys_text50" /></td>
                </tr> -->
	
				<tr>
                    <th>是否热门/推荐</th>
                    <td><label><input type="checkbox" name="is_hot" checked="checked" value="1" /> 是</label></td>
                </tr>

                <tr>
                    <th>是否启用</th>
                    <td><label><input type="checkbox" name="status" checked="checked" value="1" /> 启用</label></td>
                </tr>

                <tr>
                    <th>备注</th>
                    <td><input type="text" name="remark" id="remark" class="sys_text" /></td>
                </tr>                        
                
            </table>

            
            
        </div>        
        
        <div class="stdeditSubmit"><input type="submit" class="submit" value="提 交" /> <input type="button" value="返回上一页" class="reset" onclick="history.go(-1);" /></div>
    </div>
    </form>
    
</div>
</body>
</html>

<link rel="stylesheet" href="/Public/admin/qiniu/bootstrap.css">
<link rel="stylesheet" href="/Public/admin/qiniu/main.css">
<link rel="stylesheet" href="/Public/admin/qiniu/highlight.css">

<script type="text/javascript" src="/Public/admin/qiniu/jquery.min.js"></script>
<script type="text/javascript" src="/Public/admin/qiniu/bootstrap.min.js"></script>
<script type="text/javascript" src="/Public/admin/qiniu/moxie.js"></script>
<script type="text/javascript" src="/Public/admin/qiniu/plupload.dev.js"></script>
<!-- <script type="text/javascript" src="bower_components/plupload/js/plupload.full.min.js"></script> -->
<script type="text/javascript" src="/Public/admin/qiniu/zh_CN.js"></script>
<script type="text/javascript" src="/Public/admin/qiniu/ui.js"></script>
<script type="text/javascript" src="/Public/admin/qiniu/qiniu.js"></script>
<script type="text/javascript" src="/Public/admin/qiniu/highlight.js"></script>
<script type="text/javascript" src="/Public/admin/qiniu/main.js"></script>
<script type="text/javascript">hljs.initHighlightingOnLoad();</script>

<script type="text/javascript">
        //引入Plupload 、qiniu.js后
        var uploader = Qiniu.uploader({
        runtimes: 'html5,flash,html4',    //上传模式,依次退化
        browse_button: 'pickfiles',       //上传选择的点选按钮，**必需**
        uptoken: '<?php echo ($token); ?>',            //Ajax请求upToken的Url，**强烈建议设置**（服务端提供）
        // uptoken : '', //若未指定uptoken_url,则必须指定 uptoken ,uptoken由其他程序生成
        // unique_names: true, // 默认 false，key为文件名。若开启该选项，SDK为自动生成上传成功后的key（文件名）。
        // save_key: true,   // 默认 false。若在服务端生成uptoken的上传策略中指定了 `sava_key`，则开启，SDK会忽略对key的处理
        domain: 'http://tingxi.45tnz.com/',   //bucket 域名，下载资源时用到，**必需**
        get_new_uptoken: false,  //设置上传文件的时候是否每次都重新获取新的token
        container: 'container',           //上传区域DOM ID，默认是browser_button的父元素，
        max_file_size: '100mb',           //最大文件体积限制
        //flash_swf_url: 'js/plupload/Moxie.swf',  //引入flash,相对路径
        max_retries: 3,                   //上传失败最大重试次数
        dragdrop: true,                   //开启可拖曳上传
        drop_element: 'container',        //拖曳上传区域元素的ID，拖曳文件或文件夹后可触发上传
        chunk_size: '4mb',                //分块上传时，每片的体积
        auto_start: true,                 //选择文件后自动上传，若关闭需要自己绑定事件触发上传
        init: {
            'FilesAdded': function(up, files) {
                plupload.each(files, function(file) {
                    // 文件添加进队列后,处理相关的事情
                });
            },
            'BeforeUpload': function(up, file) {
                   // 每个文件上传前,处理相关的事情
            },
            'UploadProgress': function(up, file) {
                   // 每个文件上传时,处理相关的事情
            },
            'FileUploaded': function(up, file, info) {
                   // 每个文件上传成功后,处理相关的事情
                   // 其中 info 是文件上传成功后，服务端返回的json，形式如
                   // {
                   //    "hash": "Fh8xVqod2MQ1mocfI4S4KpRL6D98",
                   //    "key": "gogopher.jpg"
                   //  }
                   // 参考http://developer.qiniu.com/docs/v6/api/overview/up/response/simple-response.html

                   // var domain = up.getOption('domain');
                   // var res = parseJSON(info);
                   // var sourceLink = domain + res.key; 获取上传成功后的文件的Url
            },
            'Error': function(up, err, errTip) {
                   //上传出错时,处理相关的事情
            },
            'UploadComplete': function() {
                   //队列文件处理完毕后,处理相关的事情
            },
            'Key': function(up, file) {
                // 若想在前端对每个文件的key进行个性化处理，可以配置该函数
                // 该配置必须要在 unique_names: false , save_key: false 时才生效
 
                var key = "";
                // do something with key here
                return key
            }
        }
    });

</script>